package xyz.lne.researchgroupmanage.service;

import org.springframework.transaction.annotation.Transactional;
import xyz.lne.researchgroupmanage.entity.Keyword;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.lne.researchgroupmanage.service.dataTransferObject.KeyWordDTO;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author team7
 * @since 2021-01-19
 */
public interface KeywordService extends IService<Keyword> {

    /**
     * 根据课题组Id查询本课题组所有关键词
     * @param researchGroupId
     * @return
     */
    @Transactional
    List<KeyWordDTO> findKeywordByResearchGroupId(Integer researchGroupId);

    /**
     * 根据课题Id查询本课题所有关键词
     * @param researchId
     * @return
     */
    @Transactional
    List<KeyWordDTO> findKeywordByResearchId(Integer researchId);

    /**
     * 查找是否有相关关键字 无则新建 有则返回id
     * @param keyword
     * @return
     */
    @Transactional
    List<KeyWordDTO> findKeyword(String keyword);

    /**
     * 返回输入为空的关键词推荐
     * @return
     */
    List<KeyWordDTO> getDefaultKeywordList();

}
